home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8897 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Problem Negating an Unsigned Char
  5. Date: 7 Mar 1996 01:16:48 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4hm9i0INNoio@keats.ugrad.cs.ubc.ca>
  8. References: <Dnnros.Lq.0.-s@hkusuc.hku.hk> <DnqMyr.4pF@cwi.nl> <4hfmmgINN4t8@anvil.ugrad.cs.ubc.ca> <TANMOY.96Mar4203146@qcd.lanl.gov>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <TANMOY.96Mar4203146@qcd.lanl.gov>,
  12. Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov> wrote:
  13.  >In article <4hfmmgINN4t8@anvil.ugrad.cs.ubc.ca>
  14.  >c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
  15.  ><snip>
  16.  >KK: Casting to an unsigned quantity is implementation defined. 
  17.  >
  18.  >Incorrect. Casting to signed is indeed implementation defined: casting
  19.  >to unsigned is perfectly well defined by the standard.
  20.  >
  21.  >In two's complement arithmetic, it involves no change in the
  22.  >bitpattern. In others, the bit pattern may change.
  23.  >
  24.  >I know that you know this: it is just the statement that is misleading. 
  25.  
  26. Oops. What I should have said was that "depending on a cast to unsigned to do
  27. bit truncation involves an implementation-specific assumption", rather than
  28. saying that the operation itself is implementation defined.
  29. -- 
  30.  
  31.